export default function userReducer(state = initialState, action) {
    // console.log(state, 'counter')

    switch (action.type) {
        case 'setLoginInfo':
            let text = action.text;
            return Object.assign({}, state, {
                token: text.token,
                userInfo: text.userInfo
            });
        case 'sayHello': return Object.assign({}, state, {
            hello: state.hello + 'hello! '
        });
        default: return state;
    }
}

const initialState = {
    token: '',
    userInfo: {}
}